/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import controller.CharterControllerImpl;
import controller.ICharterController;
import controller.ProductController;
import execution.Util;
import java.io.IOException;
import java.util.ArrayList;
import javax.swing.JFrame;
import management.RequestManager;
import java.util.List;
import javax.swing.JOptionPane;
import model.Charter;
import model.Session;

/**
 *
 * @author heitor
 */
public class NewSessionPanelForm extends javax.swing.JPanel {

    private final RequestManager rm;
    private final ICharterController charterController;
    private List<Charter> charters;
    private Charter charter;
    private final EntryPoint mainFrame;
    private final ProductController productController;

    /**
     * Creates new form NewSessionPanelForm
     */
    public NewSessionPanelForm(EntryPoint mainFrame) {
        productController = ProductController.getInstance();
        this.mainFrame = mainFrame;
        rm = new RequestManager(new JFrame());
        charterController = new CharterControllerImpl();

        try {
            charters = charterController.getCharters("charterDao.xml");
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null, rm.loadProperty(EntryPoint.getLanguage() + "_Charter_load_error"));
            charters = new ArrayList<Charter>();
        }

        if (!charters.isEmpty()) {
            charter = charters.get(0);
        } else {
            charter = new Charter();
        }
        initComponents();
        manuallyInitComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        newSessionLabel = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        testerNameLabel = new javax.swing.JLabel();
        testerIDLabel = new javax.swing.JLabel();
        durationLabel = new javax.swing.JLabel();
        productLabel = new javax.swing.JLabel();
        charterLabel = new javax.swing.JLabel();
        testerNameField = new javax.swing.JTextField();
        testerIdField = new javax.swing.JTextField();
        durationField = new javax.swing.JTextField();
        productCombo = new javax.swing.JComboBox();
        charterInfoLabel = new javax.swing.JLabel();
        nameLabel = new javax.swing.JLabel();
        charterObjectiveLabel = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        charterObjective = new javax.swing.JTextArea();
        jScrollPane3 = new javax.swing.JScrollPane();
        requirements = new javax.swing.JTextArea();
        Requiremets = new javax.swing.JLabel();
        setupLabel = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        setup = new javax.swing.JTextArea();
        notesLabel = new javax.swing.JLabel();
        jScrollPane5 = new javax.swing.JScrollPane();
        notes = new javax.swing.JTextArea();
        keyAreasLabel = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        keyAreas = new javax.swing.JTextArea();
        jLabel3 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        issuesToBeAware = new javax.swing.JTextArea();
        impNotes = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        impExecNotes = new javax.swing.JTextArea();
        minDuration = new javax.swing.JLabel();
        maxDuration = new javax.swing.JLabel();
        startButton = new javax.swing.JButton();
        jScrollPane9 = new javax.swing.JScrollPane();
        charterList = new javax.swing.JList();

        newSessionLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_New_session"));

        testerNameLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Tester"));

        testerIDLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_ID"));

        durationLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Duration"));

        productLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Product"));

        charterLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter"));

        testerNameField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                testerNameFieldActionPerformed(evt);
            }
        });

        durationField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                durationFieldKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                durationFieldKeyTyped(evt);
            }
        });

        productCombo.setModel(new javax.swing.DefaultComboBoxModel(productController.getProductNames()));
        productCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productComboActionPerformed(evt);
            }
        });

        charterInfoLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_info"));

        nameLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_name"));

        charterObjectiveLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_objective"));

        charterObjective.setEditable(false);
        charterObjective.setColumns(20);
        charterObjective.setRows(5);
        jScrollPane2.setViewportView(charterObjective);

        requirements.setEditable(false);
        requirements.setColumns(20);
        requirements.setRows(5);
        jScrollPane3.setViewportView(requirements);

        Requiremets.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_requirements"));

        setupLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_setup"));

        setup.setEditable(false);
        setup.setColumns(20);
        setup.setRows(5);
        jScrollPane4.setViewportView(setup);

        notesLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_notes"));

        notes.setEditable(false);
        notes.setColumns(20);
        notes.setRows(5);
        jScrollPane5.setViewportView(notes);

        keyAreasLabel.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_key_areas"));

        keyAreas.setEditable(false);
        keyAreas.setColumns(20);
        keyAreas.setRows(5);
        jScrollPane6.setViewportView(keyAreas);

        jLabel3.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_issues_to_be_aware"));

        issuesToBeAware.setEditable(false);
        issuesToBeAware.setColumns(20);
        issuesToBeAware.setRows(5);
        jScrollPane7.setViewportView(issuesToBeAware);

        impNotes.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_important_notes"));

        impExecNotes.setEditable(false);
        impExecNotes.setColumns(20);
        impExecNotes.setRows(5);
        jScrollPane8.setViewportView(impExecNotes);

        minDuration.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_min_time"));

        maxDuration.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Charter_max_time"));

        startButton.setText(rm.loadProperty(EntryPoint.getLanguage()+"_Start_Session"));
        startButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startButtonActionPerformed(evt);
            }
        });

        charterList.setModel(new javax.swing.AbstractListModel() {
            public int getSize() { return charters.size(); }
            public Object getElementAt(int i) { return charters.get(i); }
        });
        charterList.setMaximumSize(new java.awt.Dimension(258, 84));
        charterList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                charterListValueChanged(evt);
            }
        });
        if (charters != null && charters.size() > 0) {
            charterList.setSelectedIndex(0);
        }
        jScrollPane9.setViewportView(charterList);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(testerNameLabel)
                                    .addComponent(testerIDLabel)
                                    .addComponent(durationLabel)
                                    .addComponent(productLabel)
                                    .addComponent(charterLabel))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(productCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
                                    .addComponent(durationField)
                                    .addComponent(testerIdField)
                                    .addComponent(testerNameField)))
                            .addComponent(startButton, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(charterObjectiveLabel)
                                        .addGap(149, 149, 149))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane2)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(setupLabel)
                                                .addGap(0, 0, Short.MAX_VALUE)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(notesLabel)
                                    .addComponent(Requiremets)
                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane6)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(nameLabel)
                                            .addComponent(charterInfoLabel)
                                            .addComponent(keyAreasLabel))
                                        .addGap(0, 0, Short.MAX_VALUE))
                                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(6, 6, 6)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(maxDuration)
                                            .addComponent(minDuration)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel3)
                                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(impNotes)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jScrollPane8)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(newSessionLabel)
                            .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addComponent(newSessionLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(testerNameLabel)
                    .addComponent(testerNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(charterInfoLabel)
                    .addComponent(minDuration))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(testerIDLabel)
                    .addComponent(testerIdField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nameLabel)
                    .addComponent(maxDuration))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(durationLabel)
                    .addComponent(durationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(charterObjectiveLabel)
                    .addComponent(Requiremets))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(productLabel)
                            .addComponent(productCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(charterLabel)
                            .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(startButton))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(setupLabel)
                                    .addComponent(notesLabel)))
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(keyAreasLabel)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(impNotes)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void testerNameFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_testerNameFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_testerNameFieldActionPerformed

    private void durationFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_durationFieldKeyTyped
        Util.removeInvalidChars(durationField);
    }//GEN-LAST:event_durationFieldKeyTyped

    private void durationFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_durationFieldKeyReleased
        Util.removeInvalidChars(durationField);
    }//GEN-LAST:event_durationFieldKeyReleased

    private void productComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productComboActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_productComboActionPerformed

    private void charterListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_charterListValueChanged
        charter = (Charter) charterList.getSelectedValue();
        updateCharterInfo();
    }//GEN-LAST:event_charterListValueChanged

    private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed
        Session session = new Session(charter);
        session.setDuration(durationField.getText());
        session.setTesterId(testerIdField.getText());
        session.setProduct(productController.getProductByIndex(String.valueOf(productCombo.getSelectedIndex())));
        session.setTesterName(testerNameField.getText());
        mainFrame.switchToPanel(new SessionPanelForm(session));
    }//GEN-LAST:event_startButtonActionPerformed

    public static void main(String[] args) {
        JFrame f = new JFrame();
        f.add(new NewSessionPanelForm(new EntryPoint()));
        f.pack();
        f.setVisible(true);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Requiremets;
    private javax.swing.JLabel charterInfoLabel;
    private javax.swing.JLabel charterLabel;
    private javax.swing.JList charterList;
    private javax.swing.JTextArea charterObjective;
    private javax.swing.JLabel charterObjectiveLabel;
    private javax.swing.JTextField durationField;
    private javax.swing.JLabel durationLabel;
    private javax.swing.JTextArea impExecNotes;
    private javax.swing.JLabel impNotes;
    private javax.swing.JTextArea issuesToBeAware;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextArea keyAreas;
    private javax.swing.JLabel keyAreasLabel;
    private javax.swing.JLabel maxDuration;
    private javax.swing.JLabel minDuration;
    private javax.swing.JLabel nameLabel;
    private javax.swing.JLabel newSessionLabel;
    private javax.swing.JTextArea notes;
    private javax.swing.JLabel notesLabel;
    private javax.swing.JComboBox productCombo;
    private javax.swing.JLabel productLabel;
    private javax.swing.JTextArea requirements;
    private javax.swing.JTextArea setup;
    private javax.swing.JLabel setupLabel;
    private javax.swing.JButton startButton;
    private javax.swing.JLabel testerIDLabel;
    private javax.swing.JTextField testerIdField;
    private javax.swing.JTextField testerNameField;
    private javax.swing.JLabel testerNameLabel;
    // End of variables declaration//GEN-END:variables

    private void manuallyInitComponents() {
        updateCharterInfo();
    }

    private void updateCharterInfo() {
//        nameLabel.setText(charter.getEtId() + " - " + charter.getName());
        String tempName = charter.getName();
        if (tempName.length() > 30) {
            tempName = tempName.substring(0, 30) + "...";
        }
        nameLabel.setText("ET " + charter.getEtId() + ": " + tempName);
        charterObjective.setText(charter.getObjective());
        minDuration.setText(rm.loadProperty(EntryPoint.getLanguage() + "_Charter_min_time") + " " + charter.getMinTime());
        maxDuration.setText(rm.loadProperty(EntryPoint.getLanguage() + "_Charter_max_time") + " " + charter.getMaxTime());
        charterObjective.setText(charter.getObjective());
        requirements.setText(charter.getRequirements());
        setup.setText(charter.getSetup());
        notes.setText(charter.getNotes());
        keyAreas.setText(charter.getKeyAreas());
        issuesToBeAware.setText(charter.getIssuesToBeAware());
        impExecNotes.setText(charter.getImportantNotes());
    }
}